Add nuke_format, a tool to vaporize a format. Tested on yahoo and mapsend.
authorRobert Lipe <robertlipe@gmail.com>
Wed, 8 Dec 2021 23:03:55 +0000 (18:03 -0500)
committerRobert Lipe <robertlipe@gmail.com>
Wed, 8 Dec 2021 23:03:55 +0000 (18:03 -0500)
tools/nuke_format [new file with mode: 0755]

diff --git a/tools/nuke_format b/tools/nuke_format
new file mode 100755 (executable)
index 0000000..d492a4c
--- /dev/null
@@ -0,0 +1,48 @@
+# usage nuke_format format_name
+
+SED=$(which gsed)
+EDITOR="${EDITOR:-vim}" 
+
+# $1 = format $2 = file
+remove_word() {
+#  git add $2
+  $SED -i "s/$1//g" $2
+}
+
+remove_line_containing() {
+#  git add $2
+  $SED -i "/$1/d" $2
+}
+
+# For things it's easier to just edit away.:1
+remove_manually() {
+  grep $1 $2 && $EDITOR +/$1 $2
+  # git add $2
+}
+
+remove_word $1.cc CMakelists.txt
+remove_word $1.h CMakelists.txt
+remove_word $1.cc GPSBabel.pro
+remove_word $1.h GPSBabel.pro
+
+remove_manually $1 reference/help.txt
+
+remove_line_containing $1 reference/format0.txt
+remove_line_containing $1 reference/format1.txt
+remove_line_containing $1 reference/format2.txt
+remove_manually $1 reference/format3.txt
+remove_line_containing extern.*$1 vecs.h
+remove_line_containing Format.*$1 vecs.h
+remove_line_containing include.*$1 vecs.h
+remove_manually $1 reference/format3.txt
+remove_line_containing $1 msvc/GPSBabel.vcxproj
+remove_line_containing $1 msvc/GPSBabel.vcxproj.filters
+
+git rm -f reference/$1*
+git rm -f xmldoc/formats/$1.xml
+git rm -f xmldoc/formats/options/$1.xml
+git rm -f testo.d/$1.test
+git rm -f $1.cc
+git rm -f $1.h
+
+# make && ./testo